package com.kfpanda.search.index.file;

import com.kfpanda.search.index.FileDocumentor;

/**
 * <b>ClassName:<b> FileDocumentFactory
 * <br><b>Description: <br>
 * FileDocumentor 实例创建工厂。
 * @Author: kfpanda
 * @Date：2012-1-8 下午06:04:06
 * @ModifyUser：shapecool
 *
 */
public class FileDocumentFactory {
	
	public static enum MimeTypeEnum{
		DCX, PCX, HTML, TXT, XML, AFP,
		PDF, RTF, MSWORD, MSEXCEL, MSPOWERPOINT, 
		WORDPERFECT, WORDPRO
	}
	
	/**
	 * <b>Description:<b><br>
	 * 通过mimeType 来创建FileDocumentor实例。
	 * @param mimeType
	 * @return
	 * @Author: kfpanda
	 * @ModifyUser：kfpanda
	 * @Date：2012-1-8 下午03:59:44
	 */
	public static FileDocumentor createFileDocument(String mimeType){
		FileDocumentor fileDoc = null;
		if("text/plain".equals(mimeType)){
			fileDoc = new TextDocument();
		}else if("application/msword".equals(mimeType)){
			fileDoc = new WordDocument();
		}else if("application/pdf".equals(mimeType)){
			fileDoc = new PDFDocument();//PDF
		}
		return fileDoc;
	}
}
